<?php

namespace app\api\controller;

use app\admin\model\About as AboutModel;
use app\common\controller\Api;


/**
 * 首页金刚区详情接口
 */
class About extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     *
     */
    public function index()
    {
        $this->success('获取成功', [
            '' => $this->about(), //获取金刚区详情
        ], 1);
    }

    /**
     * 列表、详情
     *
     */
    public function about()
    {
        //1=关于我们,2=玩法介绍,3=新人帮助,4=在线客服,5帮助中心
        $type = input('get.type', 1);
        $list = AboutModel::where(['status' => 1, 'type' => $type])->field('id,title,image,content')->find();
//        $data['content'] = strip_tags($data['content']);
        $this->success('获取成功', $list, 1);
    }

    public function help()
    {
        $model = new AboutModel();
        $data = $model->where(['type' => 5, 'status' => 1])
            ->field('title,image,createtime')
            ->select();
        if ($data) {
            $this->success('查询成功', $data, 1);
        }
        $this->error('查询失败', [], 500);
    }
}
